<!DOCTYPE html>
<html>
<head>
    <meta charset=utf-8"UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>个人资料</title>
    <link rel="stylesheet" href="__PUBLIC__/mui.min.css"/>
    <link rel="stylesheet" href="__PUBLIC__/mui.picker.css" />
    <link rel="stylesheet" href="__PUBLIC__/mui.poppicker.css" />
    <link rel="stylesheet" href="__PUBLIC__/iconfont.css" />
    <link rel="stylesheet" href="__PUBLIC__/app.css"/>
    <style type="text/css">
        .footer{
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            width: 100%;
            padding: 5px;
            background-color: #fff;
        }
        .btn{
            width: 100%;
            color: #fff;
            background-color: #f15e70;
        }
        .mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active{
            color: #f15e70;
            border-bottom: 2px solid #f15e70;
        }
    </style>
</head>
<body>
<header id="header" class="mui-bar mui-bar-nav">
    <h1 class="mui-title ">个人资料</h1>
    <a class="mui-icon mui-icon-left-nav mui-pull-left" onclick="javascript :history.back(-1);"></a>
</header>
<div class="mui-content">
    <div id="segmentedControl" class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-primary">
        <a class="mui-control-item mui-active" href="#item1">
            个人信息
        </a>
        <!--<a class="mui-control-item" href="#item2">-->
            <!--身份信息-->
        <!--</a>-->
        <!--<a class="mui-control-item" href="#item3">-->
            <!--资产信息-->
        <!--</a>-->
    </div>
    <div>
        <div id="item1" class="mui-control-content mui-active">
            <div class="mui-scroll">
                <form class="mui-input-group data-list">
                    <div class="mui-input-row">
                        <label>姓名</label>
                        <input type="text" placeholder="请输入姓名" id="realname" disabled readonly>
                    </div>

                    <div class="mui-input-row">
                        <label>手机号</label>
                        <input type="text" placeholder="请输入手机号" id="telephone" disabled readonly>
                    </div>

                    <div class="mui-input-row">
                        <label>密码</label>
                        <input type="password" placeholder="请输入新密码" id="password">
                    </div>

                </form>
            </div>
        </div>
      <!--  <div id="item2" class="mui-control-content">
            <form class="mui-input-group data-list">
                <div class="mui-input-row">
                    <label>职业类别</label>
                    <input type="text" placeholder="请选择职业类别" readonly="" id="profession" id="occupation" value="" data-id="" data-name="occupationData" class="picker">
                </div>
                <div class="mui-input-row">
                    <label>收入形式</label>
                    <input type="text" placeholder="请选择收入形式" readonly="" id="from_income" value="" data-id="" data-name="incomeData" class="picker">
                </div>
                <div class="mui-input-row">
                    <label>月收入</label>
                    <input type="text" placeholder="请输入月收入" id="monthly_income">
                </div>
                <div class="mui-input-row">
                    <label>公积金</label>
                    <input type="text" placeholder="是否有公积金" readonly="" id="is_accumulation_fund" value="" data-id="" data-name="afData" class="picker">
                </div>
            </form>
        </div>
        <div id="item3" class="mui-control-content">
            <form class="mui-input-group data-list">
                <div class="mui-input-row">
                    <label>名下有车</label>
                    <input type="text" placeholder="是否有车" readonly="" id="is_car" value="" data-id="" data-name="carData" class="picker">
                </div>
                <div class="mui-input-row">
                    <label>信用情况</label>
                    <input type="text" placeholder="信用情况" readonly="" id="credit" value="" data-id="" data-name="creditData" class="picker">
                </div>
            </form>
        </div>-->
    </div>
</div>
<nav class="footer">
    <input type="hidden" value="" id="id">
    <button type="button" class="mui-btn btn" id="submit">提交</button>
</nav>
<script src="__PUBLIC__/jquery.min.js"></script>
<!-- 皮肤 start -->
<script>
    //顶部
    $('.mui-bar').css('backgroundColor', "#f15e70");
    $('.mui-title,.mui-pull-left,.mui-pull-right').css('color', "#ffffff");
    //标题
    $('.data-list').css('color', "#f15e70");
    $('.btn, .mui-btn-custom').css({'color':"#ffffff",'backgroundColor': '#f15e70','border': '1px solid #f15e70'});
</script>
<!-- 皮肤 end -->
<script src="__PUBLIC__/mui.min.js"></script>
<script>
    var user = localStorage.getItem("user");
    $.get("/api/User/getUserInfo",{"user_id": user},function(res){
        if(res.code == 1){
            $('#realname').val(res.data.username);          // 姓名
            $('#telephone').val(res.data.mobile);         // 手机
        }
    });
   /* $(".picker").click(function() {
        var _self = this;
        var name = $(_self).attr("data-name");
        picker.setData(eval(name));
        picker.show(function(items) {
            $(_self).val(items[0]["text"]);
            $(_self).attr("data-id", items[0]["value"]);
        });
    });
    $("#submit").click(function(){
        var data = {
            "realname": $('#realname').val(),
            "telephone": $('#telephone').val(),
            "idcard": $('#idcard').val(),
            "education": $('#education').attr("data-id"),
            "profession": $('#profession').attr("data-id"),
            "from_income": $('#from_income').attr("data-id"),
            "monthly_income": $('#monthly_income').val(),
            "is_accumulation_fund": $('#is_accumulation_fund').attr("data-id"),
            "is_car": $('#is_car').attr("data-id"),
            "credit": $('#credit').attr("data-id"),
            "user_id": JSON.parse(localStorage.getItem("user"))["id"],
            "id": $('#id').val()
        };
        $.post('/index/user/setUserInfo', data, function(res){
            var jsonp = JSON.parse(res);
            mui.toast(jsonp["msg"]);
            if(jsonp["valid"]) {
                setTimeout(function(){
                    window.location.href = "/index/user/index.html";
                }, 2000);
            }
        });
    });*/

   $("#submit").click(function () {
       var _password = $('#password').val();
       $.post('/api/user/changepwd', {password:_password}, function(res){
           if (res.code == 1){
               mui.toast(res.msg);
           }else{
               mui.toast('修改失败');
           }

       });
   })
</script>
</body>
</html>